﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Skynet.WebAdministracion.Views.ImageMgm;
using Microsoft.Practices.Unity;

namespace SkynetSite.Administration
{
    public partial class MgmImages : Infrastructure.Web.Views.Page,  Skynet.WebAdministracion.Views.ImageMgm.IImageMgmView
    {
        private ImageViewPresenter _Presenter;
        [Dependency]
        public ImageViewPresenter Presenter
        {
            get { return _Presenter; }
            set {
                _Presenter = value;
                _Presenter.View = this;                 
            }

        }
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                this.Presenter.OnViewInitialized();
            this.Presenter.OnViewLoaded();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            this.Presenter.SaveImage(this.FileUpload1.FileName, this.FileUpload1.FileBytes);
        }   
    }
}